
import couponApi from '../../api/coupon'
import * as types from '../../constants/ActionTypes'

//数据概览
const getDataOverviewData = (dataOverviewData,dataType) => ({
    type: types.GET_DATA_OVERVIEW,
    dataOverviewData,
    dataType
})

export const checkDataOverviewData = (data) => dispatch => {     
    return couponApi.getDataOverviewData(data,res => {
        dispatch(getDataOverviewData(res,data.type));
    })    
}

// 英雄榜
const getHeroList = (heroData) => ({
    type: types.GET_HERO_LIST,
    heroData,
})

export const checkHeroList = (data) => dispatch => {     
    return couponApi.getHeroList(data,res => {
        dispatch(getHeroList(res));
    })    
}